<html>
<head>
    <meta charset="UTF-8">
    <title>服务器信息列表</title>
    <link id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
    <script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
    <script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
    <script src="../../ffres/dict/all.js" type="text/javascript"></script>
    <link href="../../static/easyui/themes/frameless.css" rel="stylesheet" type="text/css"/>
    <a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">

    $(function () {
        addTitle("应用选择");
        queryList();

    })
    function queryList(){
        var subsCode = $.getUrlParam("subsCode");
        var appCode=document.getElementById("appCode").value;
        var appName=document.getElementById("appName").value;
        $('#dg').datagrid({
            queryParams: {
                subsCode: subsCode,
                appCode:appCode,
                appName:appName
            }
        });
        $('#dg').datagrid({url : '../../api/sys/apps/infos'})
    }

    function selectReturn() {
        var row = $('#dg').datagrid('getSelected');
        if (row) {
            let jsonData = {
                appId:row.appId,
                appCode:row.appCode,
                appName:row.appName,
                archType:row.archType,
                appVersion:row.appVersion,
                appOrder:row.appOrder,
                gitUrl:row.gitUrl,
                jdkVersion:row.jdkVersion,
                appDesc:row.appDesc,
                subsCode:row.subsCode,
                createUser:row.createUser,
                createTime:row.createTime,
                lastUpdateUser:row.lastUpdateUser,
                lastUpdateTime:row.lastUpdateTime
            }
            window.parent.onChooseApp(jsonData)
            window.parent.JLEUtil.closewin();
        } else {
            $.messager.alert('提示', '请选择一条记录！', 'info');
        }
    }

    function closeForm() {
        window.parent.JLEUtil.closewin();
    }

    function reloadList(){
        $('#dg').datagrid('reload');
        JLEUtil.closewin();
    };

</script>
<body class="easyui-layout">
<div data-options="region:'north'"  style="height: 74px;">
    <div data-options="region:'north',title:''" style="height: 40px;">
        <div class="esaas-info-title2" style="background-color: #205081;" >
            <div style="padding: 2px;"></div>
            &nbsp;&nbsp;选择应用
            <a class="easyui-menubutton" style="position:absolute;right: 5px;top: 1px;width:22px;height: 22px;background-image: url('../../static/easyui/themes/icons/cancel6.png')"
               onclick="closeForm()"
            >
            </a>
        </div>
        <form id="searchForm">
            <table>
                <tr>
                    <td class="searchTd">&nbsp;应用代码：</td>
                    <td><input name="appCode" id="appCode"/></td>
                    <td class="searchTd">&nbsp;应用名称：</td>
                    <td><input name="appName" id="appName"/></td>
                    <td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="queryList()">查找</a></td>
                    <td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="JLEUtil.clearForm('searchForm');">清空</a></td>
                </tr>
            </table>
        </form>
    </div>
</div>
    <div data-options="region:'center',split:false">
        <table id="dg" class="easyui-datagrid" title="" style="width:100%;height:95%"
               data-options="singleSelect:true,collapsible:true,method:'post'"
               toolbar="#tb"
               title="Load Data"
               rownumbers="true" pagination="true" pageSize="20">
            <thead>
            <tr>
                <th data-options="field:'appId',resizable:true" hidden="true" >应用标识</th>
                <th data-options="field:'appCode',resizable:true" >应用代码</th>
                <th data-options="field:'appName',resizable:true" >应用名称</th>
                <th data-options="field:'archType',resizable:true" formatter="formatter_ARCH_TYPE">架构类型</th>
                <th data-options="field:'appVersion',resizable:true" >应用版本</th>
                <th data-options="field:'appOrder',resizable:true" >应用排列顺序</th>
                <th data-options="field:'gitUrl',resizable:true" >GIT仓库路径</th>
                <th data-options="field:'jdkVersion',resizable:true" formatter="formatter_JDK_VERSION">JDK版本</th>
                <th data-options="field:'appDesc',resizable:true" >应用说明</th>
                <th data-options="field:'subsCode',resizable:true" >所属系统</th>
                <th data-options="field:'createUser',resizable:true" >创建人</th>
                <th data-options="field:'createTime',resizable:true" >创建时间</th>
                <th data-options="field:'lastUpdateUser',resizable:true" >最后修改人</th>
                <th data-options="field:'lastUpdateTime',resizable:true" >最后更新时间</th>
            </tr>
            </thead>
        </table>
    </div>
<div data-options="region:'south',split:false" style="height: 105px">
    <div style="text-align: center; padding: 30px 0px 30px;height: 40px;">
        <a href="javascript:void(0)" class="easyui-linkbutton"
           onclick="selectReturn()">&nbsp;选择返回&nbsp;</a>
        <a href="javascript:void(0)" class="easyui-linkbutton"
           onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
    </div>
</div>
</body>

</html>